<template>
  <div>
    购物车模块中的num
    <br>
    <button @click="addCartNum">购物车中的+</button>
    {{$store.state.cart.num}}
    {{ $store.getters['cart/DOUBLE_NUM'] }}
    <hr>
    用户模块中的num
    <br>
    {{$store.state.user.num}}
  </div>
</template>

<script>
export default {
  methods: {
    addCartNum () {
      this.$store.commit('cart/ADD_NUM', 20)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
